/* ili9486.h */
#ifndef __ILI9486_H__
#define __ILI9486_H__

#include <stdint.h>

#define LCD_HEIGH  320
#define LCD_WIDTH  480

/*
 +--------x------------> LCD_WIDTH
 |
 y
 |
 v
 LCD_HEIGH
*/

#define LCD_COLOR_WHITE            0xFFFF
#define LCD_COLOR_BLACK            0x0000
#define LCD_COLOR_RED              0xF800
#define LCD_COLOR_GREEN            0x07E0
#define LCD_COLOR_BLUE             0x001F
#define LCD_COLOR_YELLOW           (LCD_COLOR_RED | LCD_COLOR_GREEN)

#define LCD_COLOR_BRED             0XF81F
#define LCD_COLOR_GRED             0XFFE0
#define LCD_COLOR_GBLUE            0X07FF
#define LCD_COLOR_MAGENTA          0xF81F
#define LCD_COLOR_CYAN             0x7FFF
#define LCD_COLOR_BROWN            0XBC40 //棕色
#define LCD_COLOR_BRRED            0XFC07 //棕红色
#define LCD_COLOR_GRAY             0X8430 //灰色

void ili9486_init_hardware(void);
void ili9486_init(void);

void ili9486_set_window(uint16_t x0, uint16_t x1, uint16_t y0, uint16_t y1);
void ili9486_write_color(uint16_t color);

void ili9486_draw_pixel(uint16_t x, uint16_t y, uint16_t color);
void ili9486_clear_screen(uint16_t color);

#endif /* __ILI9486_H__ */

